<template>
  <view class="">
		<tn-nav-bar  fixed customBack :bottomShadow="false" backgroundColor="#FFFFFF">
		  <view slot="back" class='tn-custom-nav-bar__back'
		    @click="goBack">
		    <text class='icon tn-icon-left'></text>
		    <text class='icon tn-icon-home-capsule-fill'></text>
		  </view>
			<view class="tn-flex tn-flex-col-center tn-flex-row-center ">
			  <text class="tn-text-bold tn-text-xl tn-color-black">内容列表</text>
			</view>
		</tn-nav-bar>

    <view class="tn-margin tn-text-center" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
			<template v-for="(item, index) in list">
				<tn-list-cell :arrow="false" :arrowRight="false" @click="showContent(item.uid)">{{ item.title }}</tn-list-cell>
			</template>
    </view>
  </view>
</template>

<script>
  import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
	import { list } from '@/utils/api/article.js'
  export default {
    name: 'TemplateAbout',
    mixins: [template_page_mixin],
    data(){
      return {
				list: [],
				queryWhere: {
					page: 1,
					size: 20,
					cate_uid: "",
				},
			}
    },
		onLoad(params) {
			this.queryWhere.cate_uid = params.cate_uid || ""
			this.getList()
		},
    methods: {
			getList() {
				uni.showLoading({
					title: "努力加载中",
					mask: true,
				})
				list(this.queryWhere).then(res => {
					this.list.push(...res.items)
					this.queryWhere.page + res.page + 1
					uni.hideLoading()
				})
			},
			showContent(uid) {
				uni.navigateTo({
					url: "/pageC/article/content?article_uid=" + uid
				})
			}
    },
		onReachBottom() {
			this.getContent()
		}
  }
</script>

<style lang="scss" scoped>
  /* 胶囊*/
  .tn-custom-nav-bar__back {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 1000rpx;
    border: 1rpx solid rgba(255, 255, 255, 0.5);
    color: #FFFFFF;
    font-size: 18px;
    
    .icon {
      display: block;
      flex: 1;
      margin: auto;
      text-align: center;
    }
    
    &:before {
      content: " ";
      width: 1rpx;
      height: 110%;
      position: absolute;
      top: 22.5%;
      left: 0;
      right: 0;
      margin: auto;
      transform: scale(0.5);
      transform-origin: 0 0;
      pointer-events: none;
      box-sizing: border-box;
      opacity: 0.7;
      background-color: #FFFFFF;
    }
  }
	.tn-text-center {
		text-align: left;
	}
</style>
